//
//  YMFJsonFileManager.swift
//  FlyingPigeon
//
//  Created by yang on 2019/5/26.
//  Copyright © 2019年 a. All rights reserved.
//

import Foundation

class YMFJsonFileManager: NSObject {
    class func getObjectFormFile(fileName: String) -> Any? {
        let path = Bundle.main.path(forResource: fileName, ofType: "txt")
        let jsonStr = try? NSString.init(contentsOfFile: path!, encoding: String.Encoding.utf8.rawValue)
        let jsonData = try! jsonStr!.data(using: String.Encoding.utf8.rawValue)
        let dataObj = try? JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.allowFragments)
        
        return dataObj
    }
}
